<template>
  <div class="row justify-content-center">
    <div class="col-8">
      <div v-if="studentScore">
        <h2 class="jh-entity-heading" data-cy="studentScoreDetailsHeading"><span>StudentScore</span> {{ studentScore.id }}</h2>
        <dl class="row jh-entity-details">
          <dt>
            <span>Score</span>
          </dt>
          <dd>
            <span>{{ studentScore.score }}</span>
          </dd>
          <dt>
            <span>Score Status</span>
          </dt>
          <dd>
            <span>{{ studentScore.scoreStatus }}</span>
          </dd>
          <dt>
            <span>Student</span>
          </dt>
          <dd>
            <div v-if="studentScore.student">
              <router-link :to="{ name: 'StudentView', params: { studentId: studentScore.student.id } }">{{
                studentScore.student.id
              }}</router-link>
            </div>
          </dd>
          <dt>
            <span>Teacher</span>
          </dt>
          <dd>
            <div v-if="studentScore.teacher">
              <router-link :to="{ name: 'TeacherView', params: { teacherId: studentScore.teacher.id } }">{{
                studentScore.teacher.id
              }}</router-link>
            </div>
          </dd>
          <dt>
            <span>User Class</span>
          </dt>
          <dd>
            <div v-if="studentScore.userClass">
              <router-link :to="{ name: 'UserClassView', params: { userClassId: studentScore.userClass.id } }">{{
                studentScore.userClass.id
              }}</router-link>
            </div>
          </dd>
        </dl>
        <button type="submit" v-on:click.prevent="previousState()" class="btn btn-info" data-cy="entityDetailsBackButton">
          <font-awesome-icon icon="arrow-left"></font-awesome-icon>&nbsp;<span> Back</span>
        </button>
        <router-link
          v-if="studentScore.id"
          :to="{ name: 'StudentScoreEdit', params: { studentScoreId: studentScore.id } }"
          custom
          v-slot="{ navigate }"
        >
          <button @click="navigate" class="btn btn-primary">
            <font-awesome-icon icon="pencil-alt"></font-awesome-icon>&nbsp;<span> Edit</span>
          </button>
        </router-link>
      </div>
    </div>
  </div>
</template>

<script lang="ts" src="./student-score-details.component.ts"></script>
